1. Field of the Invention
The present invention relates generally to code testing and in particular to code testing in a model-based testing system.
2. Background Information
Model-based testing works well in a single threaded environment where the order of operations is the same for both the model and the system under test. However, should a test be attempted using model-based testing in a multi-threaded environment, it becomes very difficult to ensure that the model still matches the system under test, and if they do not match, then is it valid that they do not match.
Further, the model and system under test may deal with requests in different orders due to their internal timing. For example if two requests (one to delete, and one to retrieve a document) arrive, the model may do the delete first and the retrieve subsequently, returning a “no document” or an exception. The system under test may execute the requests in the reverse order, returning the document, then deleting it. This type of mismatch is generally possible for any data or object modifying operations. Thus, there may be timing related mismatches between results from the model and the system under test and these will be reported as test failures.
Creating a model with the same timing as the system under test is not generally possible because the languages used to develop model and system under test are often different and the code paths in a model are generally far shorter than those in the real system under test.